package com.zhaolin.utils;

import com.zhaolin.entity.Admin;
import com.zhaolin.mapper.AdminDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SystemInit {

    @Autowired
    private AdminDao adminDao;

    public  static Map<Integer,Admin>adminMap = new HashMap<>();

    public  void init(){
        System.out.println();
        List<Admin>list = adminDao.query(null);
        for (Admin admin :list){
            adminMap.put(admin.getId(),admin);
        }
        System.out.println("初始化加载数据..."+adminMap);
    }
}
